package com.film.utils;

import com.mysql.cj.jdbc.Driver;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.Properties;

public class MySqlConnection {

    public static Connection connect;
    public static void connection() throws SQLException {
        Driver driver = new Driver();
        //数据库名称需要为movie
        String url = "jdbc:mysql://49.233.9.115:3306/movie?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8";
        Properties info = new Properties();
        info.setProperty("user", "root");
        String password = "wxq123321";// 本地mysql root的密码
        info.setProperty("password", password);
        connect = driver.connect(url, info);
        System.out.println(connect);


    }
}
